if ENEIDA_UTIL_INCLUDE = 'DATA'

STBI_default = 0
STBI_grey = 1
STBI_grey_alpha = 2
STBI_rgb = 3
STBI_rgb_alpha = 4

_func_define stbi_load
_func_define stbi_image_free

align 8
_libstb_image dq 0
_str_libstb_image db './lib/libstb_image.so',0

else if ENEIDA_UTIL_INCLUDE = 'CODE'

stb_image_init:
    sub rsp,8
    mov rdi,_str_libstb_image
    mov esi,1
    call [dlopen]
    mov [_libstb_image],rax
    _func_load [_libstb_image],stbi_load
    _func_load [_libstb_image],stbi_image_free
    add rsp,8
    ret

end if
